import React, { createRef, useRef, Fragment } from 'react';
import { Button } from 'antd';

const useFefConponent = () => {
    const input = useRef(createRef());
    const updateInput = () => {
        console.error(input);
        console.group('input');
        console.log('group');
        console.groupEnd('input');
        console.log(input.current);
        console.dir(input.current);
        input.current.value = new Date().getTime();
    };

    return (
        <Fragment>
            <input type="text" ref={input} />
            <p>点击按钮更新input输入框内容</p>
            <Button onClick={updateInput}>更新</Button>
        </Fragment>
    );
};
export default useFefConponent;
